package com.alks.function.controller.administration;

import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.WebLogger;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.function.data.request.administration.*;
import com.alks.function.service.administration.PcEmployeeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

@ApiRestController("/Employee")
@Api(tags = "行政人事-人事-作业模块-员工资料作业")
@Slf4j
public class PcEmployeeController {

    @Resource
    private PcEmployeeService pcEmployeeService;

    @ApiOperation(value = "员工资料查询",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/getPcEmployee")
    @WebLogger
    public ResponseInfo getPcEmployee(@RequestBody PcEmployeeRequest request) {
        return pcEmployeeService.getEmployeeInfo(request);
    }

    @ApiOperation(value = "新员工建档-插入员工资料",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/getPcEmployeeAdd")
    @WebLogger
    public ResponseInfo getPcEmployeeAdd(@RequestBody PcEmployeeAddRequest request) {
        return pcEmployeeService.getPcEmployeeAdd(request);
    }

    @WebLogger
    @ApiOperation(value = "新员工建档-职务建档列表",tags = "行政人事-人事-作业模块-员工资料作业")
    @GetMapping("/getDutiesList")
    public ResponseInfo getDutiesList() {
        return pcEmployeeService.getDutiesList();
    }

    @WebLogger
    @ApiOperation(value = "新员工建档-职务建档添加",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/getDutiesAdd")
    public ResponseInfo getDutiesAdd(@RequestBody Map<String,String> map) {
        return pcEmployeeService.getDutiesAdd(map);
    }

    @WebLogger
    @ApiOperation(value = "新员工建档-职务建档删除",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/getDutiesDel")
    public ResponseInfo getDutiesDel(@RequestParam(value = "positionSeq") String positionSeq) {
        return pcEmployeeService.getDutiesDel(positionSeq);
    }

    @WebLogger
    @ApiOperation(value = "新员工建档-职务建档修改",tags = "行政人事-人事-作业模块-员工资料作业")
    @PutMapping("/getDutiesUpdate")
    public ResponseInfo getDutiesUpdate(@RequestBody Map<String,String> map) {
        return pcEmployeeService.getDutiesUpdate(map);
    }

    @WebLogger
    @ApiOperation(value = "新员工建档-工种建档列表",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/getWorkTypeList")
    public ResponseInfo getWorkTypeList(@RequestBody PcEmployeeWokeTypeRequest request) {
        return pcEmployeeService.getWorkTypeList(request);
    }

    @WebLogger
    @ApiOperation(value = "新员工建档-工种建档新增",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/getWorkTypeAdd")
    public ResponseInfo getWorkTypeAdd(@RequestBody PcEmployeeWokeTypeAddRequest request) {
        return pcEmployeeService.getWorkTypeAdd(request);
    }

    @WebLogger
    @ApiOperation(value = "新员工建档-工种建档修改",tags = "行政人事-人事-作业模块-员工资料作业")
    @PutMapping("/getWorkTypeUpdate")
    public ResponseInfo getWorkTypeUpdate(@RequestBody PcEmployeeWokeTypeAddRequest request) {
        return pcEmployeeService.getWorkTypeUpdate(request);
    }

    @WebLogger
    @ApiOperation(value = "新员工建档-工种建档删除",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/getWorkTypeDel")
    public ResponseInfo getWorkTypeDel(@RequestParam(value = "workTypeSeq") String workTypeSeq) {
        return pcEmployeeService.getWorkTypeDel(workTypeSeq);
    }

    @WebLogger
    @ApiOperation(value = "新员工建档-确认员工资料",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/getConfirmEmployeeInformation")
    public ResponseInfo getConfirmEmployeeInformation(@RequestParam(value = "idNo") String idNo) {
        return pcEmployeeService.getConfirmEmployeeInformation(idNo);
    }

    @WebLogger
    @ApiOperation(value = "新员工建档-待确认员工资料明细",tags = "行政人事-人事-作业模块-员工资料作业")
    @GetMapping("/getConfirmedEmployeeInformationDetails")
    public ResponseInfo getConfirmedEmployeeInformationDetails() {
        return pcEmployeeService.getConfirmedEmployeeInformationDetails();
    }

    @WebLogger
    @ApiOperation(value = "新员工建档-待确认员工资料明细修改",tags = "行政人事-人事-作业模块-员工资料作业")
    @PutMapping("/getConfirmedEmployeeInformationDetailsUpdate")
    public ResponseInfo getConfirmedEmployeeInformationDetailsUpdate(@RequestBody PcEmployeeAddRequest request) {
        return pcEmployeeService.getConfirmedEmployeeInformationDetailsUpdate(request);
    }

    @WebLogger
    @ApiOperation(value = "新员工建档-待确认员工资料明细删除",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/getConfirmedEmployeeInformationDetailsDel")
    public ResponseInfo getConfirmedEmployeeInformationDetailsDel(@RequestParam(value = "idNo") String idNo) {
        return pcEmployeeService.getConfirmedEmployeeInformationDetailsDel(idNo);
    }

    @WebLogger
    @ApiOperation(value = "员工资料明细",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/getEmployeeInformationDetails")
    public ResponseInfo getEmployeeInformationDetails(@RequestBody PcEmployeeRequest2 request) {
        return pcEmployeeService.getEmployeeInformationDetails(request);
    }

    @WebLogger
    @ApiOperation(value = "员工资料修改",tags = "行政人事-人事-作业模块-员工资料作业")
    @PutMapping("/getEmployeeInformationUpdate")
    public ResponseInfo getEmployeeInformationUpdate(@RequestBody PcEmployeeUpdateRequest request) {
        return pcEmployeeService.getEmployeeInformationUpdate(request);
    }

    @WebLogger
    @ApiOperation(value = "奖惩资料建档-根据工号查询",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/getFiling0fRewardAndPunishmentMaterials")
    public ResponseInfo getFiling0fRewardAndPunishmentMaterials(@RequestParam(value = "workerId") String workerId ) {
        return pcEmployeeService.getFiling0fRewardAndPunishmentMaterials(workerId);
    }

    @WebLogger
    @ApiOperation(value = "奖惩资料建档-插入奖惩资料",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/InsertRewardAndPunishmentInformation")
    public ResponseInfo InsertRewardAndPunishmentInformation(@RequestBody PcEmployeeAwardAddRequest request) {
        return pcEmployeeService.InsertRewardAndPunishmentInformation(request);
    }

    @WebLogger
    @ApiOperation(value = "奖惩资料建档-查询",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/SearchForRewardAndPunishmentInformation")
    public ResponseInfo SearchForRewardAndPunishmentInformation(@RequestBody PcEmployeeAwardGetRequest request) {
        return pcEmployeeService.SearchForRewardAndPunishmentInformation(request);
    }

    @WebLogger
    @ApiOperation(value = "奖惩资料建档-删除",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/delForRewardAndPunishmentInformation")
    public ResponseInfo delForRewardAndPunishmentInformation(@RequestParam(value = "id") Integer id) {
        return pcEmployeeService.delForRewardAndPunishmentInformation(id);
    }

    @WebLogger
    @ApiOperation(value = "原因建档-查询",tags = "行政人事-人事-作业模块-员工资料作业")
    @GetMapping("/getReasonFilingList")
    public ResponseInfo getReasonFilingList () {
        return pcEmployeeService.getReasonFilingList();
    }

    @WebLogger
    @ApiOperation(value = "原因建档-插入",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/getReasonFilingAdd")
    public ResponseInfo getReasonFilingAdd (@RequestBody Map<String,String> map) {
        return pcEmployeeService.getReasonFilingAdd(map);
    }

    @WebLogger
    @ApiOperation(value = "原因建档-删除",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/getReasonFilingDel")
    public ResponseInfo getReasonFilingDel (@RequestParam String delReason) {
        return pcEmployeeService.getReasonFilingDel(delReason);
    }

    @WebLogger
    @ApiOperation(value = "部门异动-异动确认",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/ConfirmationOfChanges")
    public ResponseInfo ConfirmationOfChanges (@RequestBody DepartmentalChangesRequest request) {
        return pcEmployeeService.ConfirmationOfChanges(request);
    }

    @WebLogger
    @ApiOperation(value = "部门异动-异动确认查询",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/ConfirmationOfChangesList")
    public ResponseInfo ConfirmationOfChangesList (@RequestBody GetRequest request) {
        return pcEmployeeService.ConfirmationOfChangesList(request);
    }

    @WebLogger
    @ApiOperation(value = "职务变更-职务确认",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/ChangeOfPosition")
    public ResponseInfo ChangeOfPosition (@RequestBody ChangeOfPositionRequest request) {
        return pcEmployeeService.ChangeOfPosition(request);
    }

    @WebLogger
    @ApiOperation(value = "职务变更-职务变更查询",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/ChangeOfPositionList")
    public ResponseInfo ChangeOfPositionList (@RequestBody GetRequest request) {
        return pcEmployeeService.ChangeOfPositionList(request);
    }

    @WebLogger
    @ApiOperation(value = "工种变更-变更确认",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/JobTypeChange")
    public ResponseInfo JobTypeChange (@RequestBody JobTypeChangeRequest request) {
        return pcEmployeeService.JobTypeChange(request);
    }

    @WebLogger
    @ApiOperation(value = "工种变更-工种变更查询",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/JobTypeChangeList")
    public ResponseInfo JobTypeChangeList (@RequestBody GetRequest request) {
        return pcEmployeeService.JobTypeChangeList(request);
    }

    @WebLogger
    @ApiOperation(value = "离职作业-离职确认",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/ConfirmationOfResignation")
    public ResponseInfo ConfirmationOfResignation (@RequestBody DepartRequest request) {
        return pcEmployeeService.ConfirmationOfResignation(request);
    }

    @WebLogger
    @ApiOperation(value = "离职作业-离职查询",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/ConfirmationOfResignationList")
    public ResponseInfo ConfirmationOfResignationList (@RequestBody GetRequest request) {
        return pcEmployeeService.ConfirmationOfResignationList(request);
    }

    @WebLogger
    @ApiOperation(value = "离职作业-还原",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/ConfirmationOfResignationReduction")
    public ResponseInfo ConfirmationOfResignationReduction (@RequestParam(value = "idNo") String idNo) {
        return pcEmployeeService.ConfirmationOfResignationReduction(idNo);
    }

    @WebLogger
    @ApiOperation(value = "离职作业-导出",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/ExportResignationAssignment")
    public void ExportResignationAssignment (@RequestBody GetRequest request, HttpServletResponse response) {
         pcEmployeeService.ExportResignationAssignment(request,response);
    }

    @WebLogger
    @ApiOperation(value = "银行卡变更信息-变更确认",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/BankCardChange")
    public ResponseInfo BankCardChange (@RequestBody BankCardChangeRequest request) {
        return pcEmployeeService.BankCardChange(request);
    }

    @WebLogger
    @ApiOperation(value = "银行卡变更信息-银行变更资料查询",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/BankCardChangeList")
    public ResponseInfo BankCardChangeList (@RequestBody GetRequest request) {
        return pcEmployeeService.BankCardChangeList(request);
    }

    @WebLogger
    @ApiOperation(value = "员工变更查询",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/EmployeeChangesList")
    public ResponseInfo EmployeeChangesList (@RequestBody EmployeeChangesRequest request) {
        return pcEmployeeService.EmployeeChangesList(request);
    }

    @ApiOperation(value = "花名册导出",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/exportPcEmployee")
    @WebLogger
    public void exportPcEmployee(@RequestBody PcEmployeeRequest request,HttpServletResponse response) {
        pcEmployeeService.exportPcEmployee(request,response);
    }

    @ApiOperation(value = "花名册导出2",tags = "行政人事-人事-作业模块-员工资料作业")
    @PostMapping("/exportPcEmployee2")
    @WebLogger
    public void exportPcEmployee2(@RequestBody PcEmployeeRequest2 request,HttpServletResponse response) {
        pcEmployeeService.exportPcEmployee2(request,response);
    }
}
